<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>

<div id="" class="body_content">
<? $counter = 1;  ?>
<? foreach ($groups as $group ){  ?>

	<h3><?=$group->gr_title?></h3>
	
	<table width="100%" id="bin"cellspacing="0" cellpadding="5" >
	
		<tr>
                        <th>Тип</th>
                        <th colspan="2">Фирма</th>
			<th>Модель</th>   
			<th>Цена на<br/>сайте</th> 
			<th>Цена в<br/>магазине</th> 
			<th>Экономия</th>
			<th>Отложить</th>
		</tr>
		
		
	<? foreach ($items as $key ){  ?>
	
		<? if ($key->gr_id == $group->gr_id) {  ?>
			<? $counter ++;?>
			<? if ($counter % 2 == 0) {$bg = '#f0f9fb';}else{$bg = '#FFFFFF';}; ?>
			<tr bgcolor="<?=$bg?>" >
                                <td class="catalog" width="20%"><?=$key->tp_title?></td>
				<td class="catalog" width="20%"><?=$key->fr_title?></td>
				<td class="catalog" width="20">
                                    <? if (!empty($key->it_note1) && file_exists(SERVER_PATH.'avatars/'.$key->it_note1)) : ?>

                                            <a  title="Получить подробную информацию о <?=html::specialchars($key->it_model)?>" class="highslide" href="/avatars/<?=$key->it_note1?>" onclick="hs.expand(this, { wrapperClassName: 'highslide-white', outlineType: 'rounded-white', dimmingOpacity: 0.75, align: 'center', captionText: '<?=$key->it_model?>' }); return false;">
                                                  <img  src="/img/enlarge.gif" title="<?=html::specialchars($key->it_model)?>" alt="Изображение <?=html::specialchars($key->it_model)?>" border="0" />
                                            </a>
                                    <? else: ?>
                                        &nbsp;
                                    <? endif ?>
                               </td>
				<td class="catalog"  width="50%"  >
                	<? if (!empty($key->it_note2) && file_exists(SERVER_PATH.'desc/'.$key->it_note2)) : ?>
                		<a style="font-size:12px;" href="/item:<?=$key->it_link?>" title="Получить подробную информацию о <?=html::specialchars($key->it_model)?>"><?=html::specialchars($key->it_model)?></a>
                	<? else :?>
                		<?=html::specialchars($key->it_model)?>
                	<? endif ?>
                                    
                </td>
				<td  width="10%" nowrap="nowrap"><?=money(formula($key));?> </td>
				<td  width="10%" nowrap="nowrap"><?=money($key->it_shop_price);?> </td>
				<td  width="10%" nowrap="nowrap"><?=money(($key->it_shop_price) - (formula($key)) );?></td>
				<td  width="2%">



			<div id="link_<?=$key->it_id?>" class="ie6 <? if (@isset($items_ses[$key->it_id]) || @intval($items_ses[$key->it_size]) == 0) { echo 'item_desc'; } ?>">
				<? if(@intval($items_ses[$key->it_size]) != 0):  ?>
					Нет в наличии
				<? elseif (!isset($items_ses[$key->it_id])) : ?>
				
					<div id="order_item_<?=$key->it_id?>_it" class="count_it_edit in_catalog" style="display: none; ">
						Укажите количество, в <?=$key->it_metric?>:<br/><img alt="" src="/img/catalog_line.jpg"/><br/>
						<input type="text" size="3" id="order_item_<?=$key->it_id?>_value" name="items" value=""></input>&nbsp;&nbsp;<a href="" title="" onClick="$('#link_<?=$key->it_id?>').attr('innerHTML', RealEs.getItem('<?=$key->it_id?>', $('#order_item_<?=$key->it_id?>_value').val())).attr('className', 'item_desc' ); RealEs.order(0, <?=$key->it_id?>); return false;">Ok</a> | <a href="" title="" onClick="RealEs.order(0, <?=$key->it_id?>); return false;">Отмена</a>
					</div>
					
					<div id="order_item_<?=$key->it_id?>" class="count_it">
						<a id="catalog" href="#store_up" title="" onClick="RealEs.order(1, <?=$key->it_id?>); return false;">&nbsp;</a>
					</div>
				
				<? else : ?>
					Отложено
				<? endif ?>
				
			</div>
			
			
			
				</td>
		  </tr> 
		<? }?>
	<? }?>
	</table>
<? }?>

</div>
